public Node getLoopNode(Node head){
    if(head==null||head.next==null||head.next.next==null){
        return null;
    }

    Node n1=head.next;//slow
    Node n2=head.next.next;//fast

    while(n1!=n2){
        if(n2.next==null||n2.next.next==null){
            return null;
        }
        n2=n2.next.next;
        n1=n1.next;
    }
    n2=head;
    while(n1!=n2){
        n1=n1.next;
        n2=n2.next;
    }
    return n1;
}